import request from '@/utils/request';

export function editOwnFamily(data){
  return request({
    url:'/comprehensive/member/editOwnFamily',
    method: 'POST',
    data
  });
}


export function deleteOwnFamily(id){
  return request({
    url:`/comprehensive/member/deleteOwnFamily/${id}`,
    method:"post"
  });
}

export function addOwnFamily(data){
  return request({
    url:'/comprehensive/member/addOwnFamily',
    method:"post",
    data
  });
}

export function getOwnFamily(){
  return request({
    method: 'get',
    url:"/comprehensive/member/getOwnFamily"
  });
}

// 查询家庭成员列表
export function listMember(query) {
  return request({
    url: '/comprehensive/member/list',
    method: 'get',
    params: query
  })
}

// 查询家庭成员详细
export function getMember(id) {
  return request({
    url: '/comprehensive/member/' + id,
    method: 'get'
  })
}

// 新增家庭成员
export function addMember(data) {
  return request({
    url: '/comprehensive/member/add',
    method: 'post',
    data: data
  })
}

// 修改家庭成员
export function updateMember(data) {
  return request({
    url: '/comprehensive/member/update',
    method: 'post',
    data: data
  })
}

// 删除家庭成员
export function delMember(id) {
  return request({
    url: '/comprehensive/member/' + id,
    method: 'post'
  })
}


// fdy新增家庭成员
export function addOwnFamilyFdy(data){
  return request({
    url:'/comprehensive/member/addOwnFamily',
    method:"post",
    data
  });
}
// fdy修改家庭成员
export function editOwnFamilyFdy(data){
  return request({
    url:'/comprehensive/member/editOwnFamily',
    method: 'POST',
    data
  });
}

// fdy删除家庭成员

// export function deleteOwnFamilyFdy(id){
//   return request({

//     url:"/comprehensive/member/deleteOwnFamily/"+id+"?stuNo=" +stuNo,
//     method:"post"
//   });
// }

export function deleteOwnFamilyFdy(id,stuNo){
  return request({
    url:`/comprehensive/member/deleteFamilyByFdy?id=${id}&stuNo=${stuNo}`,
    method:"GET"
  });
}
//
export function getOwnFamilyFdy(stuNo){
  return request({
    method: 'get',
    url:"/comprehensive/member/getOwnFamily?stuNo=" + stuNo 
  });
}